package com.dhecp.project.finance.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dhecp.core.constant.DataFiltering;
import com.dhecp.core.utils.PageUtils;
import com.dhecp.project.common.service.impl.BaseModuleServiceImpl;
import com.dhecp.project.finance.domain.AccountCountForUserHistory;
import com.dhecp.project.finance.mapper.AccountCountForUserHistoryMapper;
import com.dhecp.project.finance.service.AccountCountForUserHistoryService;
import com.dhecp.project.system.service.SysDictionaryForFieldService;

/**
 * 用户历史资金 服务层
 * @author DH-Xxj
 * @version 2022年10月19日
 */
@Service
public class AccountCountForUserHistoryServiceImpl extends BaseModuleServiceImpl implements AccountCountForUserHistoryService {

	@Autowired
	private AccountCountForUserHistoryMapper businessMapper;
	
	@Autowired
	private SysDictionaryForFieldService dictionaryForFieldService;
	
	/**
	 * 查询
	 * @param params
	 * @return List - AccountCountForUserHistory
	 * @throws Exception
	 * @author DH-Xxj
	 */
	@Override
    public List<AccountCountForUserHistory> queryList(Map<String, Object> params) throws Exception {
        params.put(DataFiltering.TABLE_ALIAS, "t1");	//查询表别名
        params.put(DataFiltering.DATA_WHERE, dictionaryForFieldService.getWhereStr(params));	//常规查询条件SQL语句
        params.put(DataFiltering.DATA_SCODE, dictionaryForFieldService.getDataScode(params));	//数据权限查询条件SQL语句
        if (params.get("field") == null || params.get("field") == ""){
			String orderBy = "gDate desc, userId asc";
			PageUtils.startPageOrder(orderBy);
		}else{
			PageUtils.startPage();	
		}
        return businessMapper.selectAll(params);
    }

}
